package com.ruoyi.miniapp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.miniapp.domain.MiniActivityReview;
import com.ruoyi.miniapp.mapper.MiniActivityReviewMapper;
import com.ruoyi.miniapp.service.IMiniActivityReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 精彩回顾Service业务层处理
 * 
 * @author duantao
 * @date 2025-09-20
 */
@Service
public class MiniActivityReviewServiceImpl implements IMiniActivityReviewService
{
    @Autowired
    private MiniActivityReviewMapper miniActivityReviewMapper;

    /**
     * 查询精彩回顾
     * 
     * @param activityId 精彩回顾主键
     * @return 精彩回顾
     */
    @Override
    public MiniActivityReview selectMiniActivityReviewByActivityId(Long reviewId)
    {
        return miniActivityReviewMapper.selectMiniActivityReviewByActivityId(reviewId);
    }

    /**
     * 查询精彩回顾列表
     * 
     * @param miniActivityReview 精彩回顾
     * @return 精彩回顾
     */
    @Override
    public List<MiniActivityReview> selectMiniActivityReviewList(MiniActivityReview miniActivityReview)
    {
        return miniActivityReviewMapper.selectMiniActivityReviewList(miniActivityReview);
    }

    /**
     * 新增精彩回顾
     * 
     * @param miniActivityReview 精彩回顾
     * @return 结果
     */
    @Override
    public int insertMiniActivityReview(MiniActivityReview miniActivityReview)
    {
        miniActivityReview.setCreateTime(DateUtils.getNowDate());
        return miniActivityReviewMapper.insertMiniActivityReview(miniActivityReview);
    }

    /**
     * 修改精彩回顾
     * 
     * @param miniActivityReview 精彩回顾
     * @return 结果
     */
    @Override
    public int updateMiniActivityReview(MiniActivityReview miniActivityReview)
    {
        miniActivityReview.setUpdateTime(DateUtils.getNowDate());
        return miniActivityReviewMapper.updateMiniActivityReview(miniActivityReview);
    }

    /**
     * 批量删除精彩回顾
     * 
     * @param activityIds 需要删除的精彩回顾主键
     * @return 结果
     */
    @Override
    public int deleteMiniActivityReviewByActivityIds(Long[] activityIds)
    {
        return miniActivityReviewMapper.deleteMiniActivityReviewByActivityIds(activityIds);
    }

    /**
     * 删除精彩回顾信息
     * 
     * @param activityId 精彩回顾主键
     * @return 结果
     */
    @Override
    public int deleteMiniActivityReviewByActivityId(Long activityId)
    {
        return miniActivityReviewMapper.deleteMiniActivityReviewByActivityId(activityId);
    }
}
